﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="~/Content/icon.ico">

    <title>MediaScraper - @ViewBag.Title</title>

    <!-- Bootstrap core CSS -->
    @Styles.Render("~/Content/bootstrap")
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
</head>
    
     <body>
    <div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <@Html.ActionLink("MediaScraper", "Index", "Home",new {@class="navbar-brand"})
        </div>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li>@Html.ActionLink("Home", "Index", "Home")</li>
            <li>@Html.ActionLink("Config", "Index", "Configuration")</li>
          </ul>
        </div><!-- /.nav-collapse -->
      </div><!-- /.container -->
    </div><!-- /.navbar -->

    <div class="container"  id="mainContent">
      <div class="row row-offcanvas row-offcanvas-right">
        <div class="col-xs-12 col-sm-9">
          <p class="pull-right visible-xs">
            <button type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas">Toggle nav</button>
          </p>
              @RenderBody() 
        </div><!--/span-->

        <div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
          <div class="sidebar-nav">
            <div class="panel panel-info">
                            <div class="panel-heading">
                                <h3 class="panel-title">Scraper Service</h3>
                            </div>
                            <div class="panel-body">
                                @if (Model.ServiceRunning)
                                {
                                    <text>Service up and running</text> 
                                    using (Html.BeginForm("Stop", "Home"))
                                    {
                                        <button class="btn btn-lg btn-danger" type="submit">Stop Service</button>
                                    }
                                }
                                else
                                {
                                    <text>Service stopped</text> 
                                    using (Html.BeginForm("Start", "Home"))
                                    {
                                        <button class="btn btn-lg btn-success" type="submit">Start Service</button>
                                    }
                                }
                            </div>
                        </div>
          </div><!--/.well -->
        </div><!--/span-->
      </div><!--/row-->

   

      <div id="footer">
            <div class="container">
                <p class="text-muted credit">MediaScraper by davidroyale. Visit project on <a href="https://mediascraper.codeplex.com/">CodePlex</a>.</p>
            </div>
        </div>

    </div><!--/.container-->

        <!-- Bootstrap core JavaScript
            ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/jqueryval")
        @Scripts.Render("~/bundles/jqueryui")
        @Scripts.Render("~/bundles/bootstrap")
        @RenderSection("scripts", required: false)
        <script type="text/javascript">
            $(document).ajaxSend(function (event, request, settings) {
                $('#loading-indicator').show();
                //   $('#loading-indicator-background').show();
            });

            $(document).ajaxComplete(function (event, request, settings) {
                $('#loading-indicator').hide();
                //   $('#loading-indicator-background').hide();

            });

            $(document).ready(function () {
                $('[data-toggle=offcanvas]').click(function () {
                    $('.row-offcanvas').toggleClass('active');
                });
            });
        </script>
        <img src="/Content/loading_dark.gif" id="loading-indicator" style="display: none;" />
    </body>
</html>

